package one.stand.enums;

/**
 * @author zrh
 */

public enum OrderStateEnum {

    BE_OVERDUE(0,"已过期"),
    WAIT_PAYMENT(1,"待付款"),
    WAIT_DELIVER(2,"待发货"),
    WAIT_RECEIVING(3,"待收货"),
    COMPLETE(4,"已完成"),
    CANCEL(5,"交易取消"),
    REFUND_SUCCESS(6,"退款成功");

    private Integer code;
    private String message;

    public void setCode(Integer code){
        this.code = code;
    }
    public Integer getCode(){
        return code;
    }
    public void setMessage(String message){
        this.message = message;
    }
    public String getMessage(){
        return message;
    }
    OrderStateEnum(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    public static String getMessage(Integer value) {
        OrderStateEnum[] orderStateEnum = values();
        for (OrderStateEnum orderStateEnum1 : orderStateEnum) {
            if (orderStateEnum1.getCode().equals(value)) {
                return orderStateEnum1.getMessage();
            }
        }
        return null;
    }
}
